package com.gxuwz.medical.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.gxuwz.medical.domain.medical.Medical;
import com.gxuwz.medical.domain.medical.S201;

public class MedicalDao extends GenericDao<Medical> {

	@Override
	protected Medical handle(ResultSet rs) throws SQLException {
		Medical entity =null;
	    try{
		entity =new Medical();
		entity.setJgbm(rs.getString("jgbm"));
		entity.setZzjgbm(rs.getString("zzjgbm"));
		entity.setJgmc(rs.getString("jgmc"));
		entity.setDqbm(rs.getString("dqbm"));
		entity.setAreacode(rs.getString("areacode"));
		entity.setLsgx(new S201(rs.getString("lsgx"), "02"));
		entity.setJgjb(new S201(rs.getString("jgjb"), "06"));
		entity.setSbddlx(new S201(rs.getString("sbddlx"), "04"));
		entity.setPzddlx(new S201(rs.getString("pzddlx"), "04"));
		entity.setSsjjlx(new S201(rs.getString("ssjjlx"), "01"));
		entity.setWsjgdl(new S201(rs.getString("wsjgdl"), "03"));
		entity.setWsjgxl(new S201(rs.getString("wsjgxl"), "0301"));
		entity.setZgdw(rs.getString("zgdw"));
		entity.setKysj(rs.getString("kysj"));
		entity.setFrdb(rs.getString("frdb"));
		entity.setZczj(rs.getDouble("zczj"));
		   return entity;
	    }catch(Exception e){
	    	e.printStackTrace();
	    	throw new SQLException("结果集转换为对象失败:"+e.getMessage(),e);
	    }
	 

	}

}
